/*
* INSANE - Interactive Structural Analysis Environment
*
* Copyright (C) 2003-2005
* Universidade Federal de Minas Gerais
* Escola de Engenharia
* Departamento de Engenharia de Estruturas
* 
* Author's email :    insane@dees.ufmg.br
* Author's website :  http://www.dees.ufmg.br/insane
* 
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
package br.ufmg.dees.insane.ui.rich.learn.learn_view.dialog;

import java.awt.Color;
import java.util.ArrayList;

import javax.swing.JButton;


/**
*
* @author Moreira, Renata & Pitangueira, Roque
* @since May 2005
*/

public final class MatrixViewTable{
	private String name;
	private int nRows;
	private int nColumns;
	private String[] columnNames;
	private String[] lineNames;
	private JButton[][] cells;
	private Color color;
	
	
	/**
	 * Constructor method.
	 *	 
	 */
	public MatrixViewTable(String name, String[] columnNames, JButton[][] cells) {
	    this.name =name;
		this.cells = cells;
		this.columnNames = columnNames;
		this.nRows = cells.length;
	    this.nColumns = columnNames.length;
	}
	/**
	 * Constructor method.
	 *	 
	 */
	public MatrixViewTable(String name, String[] columnNames, ArrayList cells) {
	    this.name = name;
		this.columnNames = columnNames;
		this.nRows = cells.size();
	    this.nColumns = columnNames.length;
	}
	
	/**
	 * Constructor method.
	 *	 
	 */
	public MatrixViewTable(String name, String[] lineNames, String[] columnNames, JButton[][] cells) {
	    this.name =name;
		this.cells = cells;
		this.columnNames = columnNames;
		this.lineNames = lineNames;
		this.nRows = cells.length;
	    this.nColumns = columnNames.length;
	}
    /**
     * @return Returns the name.
     */
    public String getName() {
        return name;
    }
    /**
     * @param name The name to set.
     */
    public void setName(String name) {
        this.name = name;
    }
	    /**
     * @return Returns the cells.
     */
    public JButton[][] getCells() {
        return cells;
    }
    /**
     * @param cells The cells to set.
     */
    public void setCells(JButton[][] cells) {
        this.cells = cells;
    }
    /**
     * @return Returns the columnNames.
     */
    public String[] getColumnNames() {
        return columnNames;
    }
    /**
     * @param columnNames The columnNames to set.
     */
    public void setColumnNames(String[] columnNames) {
        this.columnNames = columnNames;
    }
    /**
     * @return Returns the nColumns.
     */
    public int getNColumns() {
        return nColumns;
    }
    /**
     * @param columns The nColumns to set.
     */
    public void setNColumns(int columns) {
        nColumns = columns;
    }
    /**
     * @return Returns the nRows.
     */
    public int getNRows() {
        return nRows;
    }
    /**
     * @param rows The nRows to set.
     */
    public void setNRows(int rows) {
        nRows = rows;
    }

    /**
     * @return Returns the color.
     */
    public Color getColor() {
        return color;
    }
    /**
     * @param color The color to set.
     */
    public void setColor(Color color) {
        this.color = color;
        for (int i = 0;  i < this.nRows; i++)
            for (int j = 0;  j < this.nColumns; j++)
                this.cells[i][j].setBackground(color);
    }
    /**
     * @return Returns the lineNames.
     */
    public String[] getLineNames() {
        return lineNames;
    }
    /**
     * @param lineNames The lineNames to set.
     */
    public void setLineNames(String[] lineNames) {
        this.lineNames = lineNames;
    }
}// End of class

//==== End of File
